<template>
  <router-view v-slot="{ Component }">
    <keep-alive :include="viewList">
      <component :is="Component" />
    </keep-alive>
  </router-view>
</template>

<script>
import { reactive, toRefs } from 'vue'
export default {
  name: 'App',
  setup() {
    const state = reactive({
      viewList: ['Home']
    })

    return {
      ...toRefs(state),
    }
  },
}
</script>

<style lang='less'>
html,
body {
  min-height: 100%;
  overflow-x: hidden;
  background-color: #f4f4f4;
}
#app {
  margin: 0 auto;
  max-width: 20rem; // 设备屏幕超过750px
  min-width: 100%;
  background-color: #fff;
}
</style>
